#include <sstream>
#include <stack>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class K
{
public:
    K(std::string number);
    K(long long number);
    K add(K other);
    K subtract(K other);
    K multiply(K other);
    K divide(K other);
    K pow(int exponent);
    std::string getString();
    K setString(const std::string &newStr);
    K negate();
    K trimLeadingZeros();
    bool equals(const K &other);
    bool equals(const long long &other);
    bool equals(const std::string &other);
    unsigned int digits();
    bool isNegative() const;
    bool isPositive();
    bool isEven();
    bool isOdd();
    K abs() const;
    friend std::ostream &operator<<(std::ostream &os, const K &num);
    friend K operator+(K b1, const K &b2);
    friend K operator+(K b1, const long long &b2);
    friend K operator+(K b1, const std::string &b2);
    friend K operator-(K b1, const K &b2);
    friend K operator-(K b1, const long long &b2);
    friend K operator-(K b1, const std::string &b2);
    friend K operator*(K b1, const K &b2);
    friend K operator*(K b1, const long long &b2);
    friend K operator*(K b1, const std::string &b2);
    friend K operator^(K b1, const int &b2);
    friend bool operator==(K b1, const K &b2);
    friend bool operator==(K b1, const long long &b2);
    friend bool operator==(K b1, const std::string &b2);
    friend bool operator>(K b1, const K &b2);
    friend bool operator<(K b1, const K &b2);
    friend bool operator>=(K b1, const K &b2);
    friend bool operator<=(K b1, const K &b2);
    K &operator=(const K &other);
    K &operator=(const long long &other);
    K &operator=(const std::string &other);
    K &operator+=(const K &other);
    K &operator+=(const long long &other);
    K &operator+=(const std::string &other);
    K &operator-=(const K &other);
    K &operator-=(const long long &other);
    K &operator-=(const std::string &other);
    K &operator*=(const K &other);
    K &operator*=(const long long &other);
    K &operator*=(const std::string &other);
    K &operator++();
    K &operator--();
    K operator++(int);
    K operator--(int);
    unsigned int operator[](int index);
private:
    std::string _numberString;
    K addll(const long long &other);
    K addstr(const std::string &other);
    K subtractll(const long long &other);
    K subtractstr(const std::string &other);
    K multiplyll(const long long &other);
    K multiplystr(const std::string &other);
    K dividell(const long long &other);
    K dividestr(const std::string &other);
};
K::K(std::string number) : _numberString(number)
{
}
K::K(long long number) : _numberString(std::to_string(number))
{
}
K K::add(K other)
{
    K b1 = other > *this ? other : *this;
    K b2 = other > *this ? *this : other;
    if (b1.isNegative() || b2.isNegative())
    {
        if (b1.isNegative() && b2.isNegative())
        {
            return b1.negate().add(b2.negate()).negate();
        }
        else if (b1.isNegative() && !b2.isNegative())
        {
            return b1.negate().subtract(b2).negate();
        }
        else
        {
            return b2.negate().subtract(b1).negate();
        }
    }
    std::string results;
    int carry = 0;
    int diff = int(b1._numberString.size() - b2._numberString.size());
    for (int i = 0; i < diff; ++i)
    {
        b2._numberString.insert(b2._numberString.begin(), '0');
    }
    for (int i = int(b1._numberString.size() - 1); i >= 0; --i)
    {
        int sum = (b1._numberString[i] - '0') + (b2._numberString[i] - '0') + carry;
        carry = 0;
        if (sum <= 9 || i == 0)
        {
            results.insert(0, std::to_string(sum));
        }
        else
        {
            results.insert(0, std::to_string(sum % 10));
            carry = 1;
        }
    }
    return K(results);
}
K K::addll(const long long &other)
{
    return this->add(K(other));
}
K K::addstr(const std::string &other)
{
    return this->add(K(other));
}
K K::subtract(K other)
{
    K b1 = *this, b2 = other;
    if (b1.isNegative() || b2.isNegative())
    {
        if (b1.isNegative() && b2.isNegative())
        {
            return b1.negate().add(b2.negate()).negate();
        }
        else if (b1.isNegative() && !b2.isNegative())
        {
            return b1.negate().add(b2).negate();
        }
        else
        {
            return b2.negate().add(b1);
        }
    }
    std::string results;
    int n = 0, p = 0;
    bool takeOffOne = false;
    bool shouldBeTen = false;
    if (b1 < b2)
    {
        std::string t = b2.subtract(*this).negate().getString();
        for (unsigned int i = 1; i < t.length(); ++i)
        {
            if (t[i] != '0')
                break;
            t.erase(1, 1);
        }
        return K(t);
    }
    if (b1._numberString.size() - b2.getString().size() > 1)
    {
        for (unsigned long i = 0; i < b1._numberString.size() - b2.getString().size() - 1; ++i)
        {
            b2._numberString.insert(b2._numberString.begin(), '0');
        }
    }
    int i = int(b1._numberString.size() - 1);
    for (int j = int(b2._numberString.size() - 1); j >= 0; --j)
    {
        if (((b1._numberString[i] - '0') < (b2._numberString[j] - '0')) && i > 0)
        {
            n = char((b1._numberString[i] - '0') + 10);
            takeOffOne = true;
            if (j > 0 || b1._numberString[i - 1] != '0')
            {
                p = char((b1._numberString[i - 1] - '0') - 1);
                if (p == -1)
                {
                    p = 9;
                    shouldBeTen = true;
                }
                takeOffOne = false;
            }
            if (shouldBeTen)
            {
                int index = i - 1;
                for (int a = i - 1; (b1._numberString[a] - '0') == 0; --a)
                {
                    b1._numberString[a] = static_cast<char>(p + '0');
                    --index;
                }
                int t = (b1._numberString[index] - '0') - 1;
                b1._numberString[index] = static_cast<char>(t + '0');
            }
            b1._numberString[i - 1] = static_cast<char>(p + '0');
            shouldBeTen = false;
        }
        std::stringstream ss;
        if (((b1._numberString[i] - '0') == (b2._numberString[j] - '0')))
        {
            ss << "0";
        }
        else
        {
            if (n <= 0)
            {
                ss << ((b1._numberString[i] - '0') - (b2._numberString[j] - '0'));
            }
            else
            {
                ss << (n - (b2._numberString[j] - '0'));
            }
        }
        results.insert(0, ss.str());
        --i;
        n = 0;
    }
    if (takeOffOne)
    {
        std::string number = "";
        for (int j = b1._numberString.length() - b2._numberString.length() - 1; j >= 0; --j)
        {
            if (b1._numberString[j] == '0')
            {
                number += "0";
                continue;
            }
            else
            {
                number.insert(number.begin(), b1._numberString[j]);
                int t = atoi(number.c_str());
                --t;
                b1._numberString.replace(0, number.size(), std::to_string(t));
                break;
            }
        }
    }
    while (i >= 0)
    {
        std::stringstream ss;
        if (i == 0)
        {
            if (b1._numberString[i] - '0' != 0)
            {
                ss << (b1._numberString[i] - '0');
                results.insert(0, ss.str());
            }
        }
        else
        {
            ss << (b1._numberString[i] - '0');
            results.insert(0, ss.str());
        }
        --i;
    }
    if (results.find_first_not_of('0') == std::string::npos)
    {
        results = "0";
    }
    else if (results[0] == '0')
    {
        int index = results.find_first_not_of('0');
        results = results.substr(index, results.length() - 1);
    }
    return K(results);
}
K K::subtractll(const long long &other)
{
    return this->subtract(K(other));
}
K K::subtractstr(const std::string &other)
{
    return this->subtract(K(other));
}
K K::multiply(K other)
{
    K b1 = other > *this ? other : *this;
    K b2 = other > *this ? *this : other;
    if (b1.isNegative() || b2.isNegative())
    {
        if (b1.isNegative() && b2.isNegative())
        {
            return b1.negate().multiply(b2.negate());
        }
        else if (b1.isNegative() && !b2.isNegative())
        {
            return b1.negate().multiply(b2).negate();
        }
        else
        {
            return b2.negate().multiply(b1).negate();
        }
    }
    if (b1 == 0 || b2 == 0)
        return 0;
    int carry = 0;
    int zeroCounter = 0;
    K b = 0;
    for (unsigned int i = 0; i < b1._numberString.size() - b2._numberString.size(); ++i)
    {
        b2._numberString.insert(b2._numberString.begin(), '0');
    }
    for (long long int i = (b2._numberString.size() - 1); i >= 0; --i)
    {
        std::string rr;
        for (long long int j = int(b1._numberString.size() - 1); j >= 0; --j)
        {
            int val = ((b2._numberString[i] - '0') * (b1._numberString[j] - '0')) + carry;
            carry = 0;
            if (val > 9 && j != 0)
            {
                carry = val / 10;
                rr.insert(0, std::to_string(val % 10));
            }
            else
            {
                rr.insert(0, std::to_string(val));
            }
        }
        if (zeroCounter > 0)
        {
            for (int x = 0; x < zeroCounter; ++x)
            {
                rr.append("0");
            }
        }
        ++zeroCounter;
        b += K(rr);
    }
    if (b._numberString.find_first_not_of('0') != std::string::npos)
    {
        b.setString(b._numberString.erase(0, b._numberString.find_first_not_of('0')));
    }
    else
    {
        b.setString("0");
    }
    return b;
}
K K::multiplyll(const long long &other)
{
    if (other == 0)
        return 0;
    if (other == 1)
        return *this;
    auto original = *this;
    for (auto i = 0; i < other - 1; ++i)
    {
        *this += original;
    }
    return *this;
}
K K::multiplystr(const std::string &other)
{
    return this->multiply(K(other));
}
std::string K::getString()
{
    return this->_numberString;
}
K K::setString(const std::string &newStr)
{
    this->_numberString = newStr;
    return *this;
}
K K::negate()
{
    if (this->_numberString[0] == '-')
    {
        this->_numberString.erase(0, 1);
    }
    else
    {
        this->_numberString.insert(this->_numberString.begin(), '-');
    }
    return *this;
}
K K::trimLeadingZeros()
{
    K b = *this;
    if (b._numberString.find_first_not_of('0') != std::string::npos)
    {
        b.setString(b._numberString.erase(0, b._numberString.find_first_not_of('0')));
    }
    return b;
}
bool K::equals(const K &other)
{
    return this->_numberString == other._numberString;
}
bool K::equals(const long long &other)
{
    return this->getString() == std::to_string(other);
}
bool K::equals(const std::string &other)
{
    return this->getString() == other;
}
unsigned int K::digits()
{
    return this->_numberString.length() - static_cast<int>(this->isNegative());
}
bool K::isNegative() const
{
    return this->_numberString[0] == '-';
}
bool K::isPositive()
{
    return !this->isNegative();
}
bool K::isEven()
{
    return this->_numberString[this->_numberString.length() - 1] % 2 == 0;
}
bool K::isOdd()
{
    return !this->isEven();
}
K K::abs() const
{
    return K(this->_numberString.substr(static_cast<unsigned int>(this->isNegative())));
}
std::ostream &operator<<(std::ostream &os, const K &num)
{
    os << num._numberString;
    return os;
}
K operator+(K b1, const K &b2)
{
    return b1.add(b2);
}
K operator+(K b1, const long long &b2)
{
    return b1.addll(b2);
}
K operator+(K b1, const std::string &b2)
{
    return b1.addstr(b2);
}
K operator-(K b1, const K &b2)
{
    return b1.subtract(b2);
}
K operator-(K b1, const long long &b2)
{
    return b1.subtractll(b2);
}
K operator-(K b1, const std::string &b2)
{
    return b1.subtractstr(b2);
}
K operator*(K b1, const K &b2)
{
    return b1.multiply(b2);
}
K operator*(K b1, const long long &b2)
{
    return b1.multiplyll(b2);
}
K operator*(K b1, const std::string &b2)
{
    return b1.multiplystr(b2);
}
bool operator==(K b1, const K &b2)
{
    return b1.equals(b2);
}
bool operator==(K b1, const long long &b2)
{
    return b1.equals(b2);
}
bool operator==(K b1, const std::string &b2)
{
    return b1.equals(b2);
}
bool operator>(K b1, const K &b2)
{
    if (b1.isNegative() || b2.isNegative())
    {
        if (b1.isNegative() && b2.isNegative())
        {
            K bt = b2;
            b1._numberString.erase(0, 1);
            bt._numberString.erase(0, 1);
            return b1 < bt;
        }
        else
        {
            return !(b1.isNegative() && !b2.isNegative());
        }
    }
    b1 = b1.trimLeadingZeros();
    auto c = K(b2);
    c = c.trimLeadingZeros();
    if (b1 == c)
    {
        return false;
    }
    if (b1._numberString.size() > c._numberString.size())
    {
        return true;
    }
    else if (c._numberString.size() > b1._numberString.size())
    {
        return false;
    }
    else
    {
        for (unsigned int i = 0; i < b1._numberString.size(); ++i)
        {
            if (b1[i] == static_cast<unsigned int>(c._numberString[i] - '0'))
            {
                continue;
            }
            return b1[i] > static_cast<unsigned int>(c._numberString[i] - '0');
        }
    }
    return false;
}
bool operator<(K b1, const K &b2)
{
    return !(b1 == b2) && !(b1 > b2);
}
bool operator>=(K b1, const K &b2)
{
    return b1 > b2 || b1 == b2;
}
bool operator<=(K b1, const K &b2)
{
    return b1 < b2 || b1 == b2;
}
unsigned int K::operator[](int index)
{
    if (this->_numberString[index] == '-')
    {
        std::cerr << "You cannot get the negative sign from the number" << std::endl;
    }
    return static_cast<unsigned int>(this->_numberString[index] - '0');
}
K &K::operator=(const K &other)
{
    this->_numberString = other._numberString;
    return *this;
}
K &K::operator=(const long long &other)
{
    this->_numberString = std::to_string(other);
    return *this;
}
K &K::operator=(const std::string &other)
{
    this->_numberString = other;
    return *this;
}
K &K::operator+=(const K &other)
{
    *this = *this + other;
    return *this;
}
K &K::operator+=(const long long &other)
{
    *this = *this + other;
    return *this;
}
K &K::operator+=(const std::string &other)
{
    *this = *this + other;
    return *this;
}
K &K::operator-=(const K &other)
{
    *this = *this - other;
    return *this;
}
K &K::operator-=(const long long &other)
{
    *this = *this - other;
    return *this;
}
K &K::operator-=(const std::string &other)
{
    *this = *this - other;
    return *this;
}
K &K::operator*=(const K &other)
{
    *this = *this * other;
    return *this;
}
K &K::operator*=(const long long &other)
{
    *this = *this * other;
    return *this;
}
K &K::operator*=(const std::string &other)
{
    *this = *this * other;
    return *this;
}
K &K::operator++()
{
    *this += K("1");
    return *this;
}
K &K::operator--()
{
    *this -= K("1");
    return *this;
}
K K::operator++(int)
{
    K t(this->getString());
    ++(*this);
    return t;
}
K K::operator--(int)
{
    K t(this->getString());
    --(*this);
    return t;
}

int main()
{
    K a("0"), b("0");
    string a1, b2, ao, mo;
    cin >> a1;
    cin >> b2;
    a.setString(a1);
    b.setString(b2);
    ao = (a+b).getString();
    mo = (a - b).getString();
    if (ao == "-0")
    {
        ao = "0";
    }
    if (a.isNegative() && b.isNegative())
    {
        mo = (b + b.abs()).getString();
    }
    if (mo == "-0")
    {
        mo = "0";
    }
    cout << ao << endl;
    cout << mo << endl;
    cout << a*b;
}